package com.xqls.dal.dao.mybatis;

import com.xqls.dal.dao.RainwaterDischargeRealdataDao;
import com.xqls.dal.model.RainwaterDischargeRealdata;
import com.xqls.dal.model.RainwaterDischargeRealdataExample;
import com.xqls.dal.service.RainwaterDischargeRealdataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class RainwaterDischargeRealdataDaoImpl implements RainwaterDischargeRealdataDao{

	@Autowired private RainwaterDischargeRealdataMapper mapper;
	@Override
	public int insertRainwaterDischargeRealdataList(RainwaterDischargeRealdata dischargeRealdata) {
		return  mapper.insert(dischargeRealdata);
	}
	
	public int updateRainwaterDischargeRealdataList(RainwaterDischargeRealdata dischargeRealdata) {
		return mapper.updateByPrimaryKeySelective(dischargeRealdata);
	}

	public List<RainwaterDischargeRealdata> queryByDeviceNo(String deviceNo){
		RainwaterDischargeRealdataExample example=new RainwaterDischargeRealdataExample();
		example.createCriteria().andDeviceNoEqualTo(deviceNo);
		return mapper.selectByExample(example);
	}

	@Override
	public List<Map<String, Object>> selectByMap(Map<String, Object> map) {
		
		return mapper.selectByMap(map);
	}

	@Override
	public List<Map<String, Object>> queryAll() {
		
		return mapper.selectAll();
	}
	
	public RainwaterDischargeRealdata selectByDeviceNo(String deviceNo){
		return mapper.selectBydeviceNo(deviceNo);
	}

	@Override
	public List<RainwaterDischargeRealdata> selectListByMap(Map<String, Object> map) {
		return mapper.selectListByMap(map);
	}

	@Override
	public List<RainwaterDischargeRealdata> selectRainwater() {
		return mapper.selectRainwater();
	}


}
